<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="x5-fullscreen" content="true">
    <meta name="full-screen" content="yes">
    <title>排行榜</title>
    <link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/base.css?v=15" />
    <link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/mod.css?v=15" />
    <link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/run.css?v=1212" />
    <script src="{$staticHost}/static/js/iscroll.js"></script>
    <script src="{$staticHost}/static/js/mod.js"></script>
    <script src="{$staticHost}/static/js/js.js"></script>
    <script src="{$staticHost}/static/js/jquery.min.js"></script>
    </head>
    <style type="text/css">

    </style>
<body onload="loaded()" class="pb50">
  <nav class="gray-nav" style="background:#fff"></nav>

  <div class="round-tab">
    <a id="all-member" class="rank_tab">最强个人</a>
    <a id="all-zlc" class="rank_tab">最强城市</a>
    <a id="all-pace" class="rank_tab">最强宠物</a>
    <a id="all-moods" class="rank_tab">景点搜索</a>
  </div>
  <div id="wrapper" style="top:50px;">
    <div id="list" class="#scroller">
      <section class="all-member pb50" style="display: none;">
        <p class="p10 ac color_gray f12">每日24点更新积分榜，竞赛第<span id="day-num">3</span>日</p>
        <section id="empty" class="empty-box no">
          <div>
            <img src="http://irun.hupu.com/static/images/bg/image1_03-min.png" >
            <p class="plr20">
            快快去备战训练为竞赛做准备吧！
            竞赛开始时再来一探究竟谁是高手吧！
            </p>
          </div>
        </section>
      
        <ul class="paome-rank top integral"> </ul>
        <ul class="paome-rank list integral"></ul>
<!--         <div class="stop dn">－－－止步于预选赛的战队－－－</div>
        <ul class="paome-rank over pb50 dn"></ul> -->
      </section>
      <!-- 全员跑量榜  更改为  积分榜 -->
      <section class="all-zlc pb50">
        <p class="p10 ac color_gray f12">榜单每日24点清零</p>
        <section id="empty" class="empty-box no">
          <div>
            <img src="http://irun.hupu.com/static/images/bg/image1_03-min.png" >
            <p class="plr20">
            快快去备战训练为竞赛做准备吧！
            竞赛开始时再来一探究竟谁是高手吧！
            </p>
          </div>
        </section>
    
        <ul class="paome-rank top"></ul>
        <ul class="paome-rank list"></ul>
  <!--       <div class="stop dn">－－－止步于预选赛的战队－－－</div>
        <ul class="paome-rank over pb50 dn"></ul> -->
      </section>
      <!-- 总里程榜 -->

      <section class="all-pace pb50" style="display: none;">
        <p class="p10 ac color_gray f12">榜单每日24点清零</p>
        <section id="empty" class="empty-box no">
          <div>
            <img src="http://irun.hupu.com/static/images/bg/image1_03-min.png" >
            <p class="plr20">
            快快去备战训练为竞赛做准备吧！
            竞赛开始时再来一探究竟谁是高手吧！
            </p>
          </div>
        </section>
       
        <ul class="paome-rank top"></ul>
        <ul class="paome-rank list"></ul>
<!--         <div class="stop dn">－－－止步于预选赛的战队－－－</div>
        <ul class="paome-rank over pb50 dn"></ul> -->
      </section>
      <!-- 配速榜 -->

      <section class="all-moods pb50" style="display: none;">
        <section id="empty" class="empty-box no">
          <div>
            <img src="http://irun.hupu.com/static/images/bg/image1_03-min.png" >
            <p class="plr20">
            快快去备战训练为竞赛做准备吧！
            竞赛开始时再来一探究竟谁是高手吧！
            </p>
          </div>
        </section>
        
        <ul class="paome-rank top"></ul>
        <ul class="paome-rank list"></ul>
<!--         <div class="stop dn">－－－止步于预选赛的战队－－－</div>
        <ul class="paome-rank over pb50 dn"></ul> -->
      </section>
      <!-- 人气榜 -->
  </div>

  <nav class="homenav">
    <a href="paomeHome"><i class="iconfont icon-zhuye"></i>首 页</a>
    <a class="on" href="paomeRank"><i class="iconfont icon-paihangbang"></i> 排行榜</a>
    <a href="paoLobby"><i class="iconfont icon-dating"></i>大 厅</a>
     <a href="meCenter">
       <i class="iconfont icon-wode">
           {if $msgNoReadNum>0}
            <sub id="nav-news">●</sub>
           {/if}
        </i>
        我的
    </a>
  </nav>
  <!-- 主导航 -->
</body>
<script id="all-zlc_tpl" type="text/html">
  <% for(var i = 0; i < ranklist.length; i++) { %>
  <li<% if(isMe != undefined && isMe == 1) { %> class="me"<% } %>>
    <div>
      <span<% if(ranklist[i].rankValue   * 1 < 0) { %> class="down"<% } else if(ranklist[i].rankValue   * 1 > 0) { %> class="up"<% } %>>
        <b><% if(!ranklist[i].rank) { %>--<% } else { %><%=ranklist[i].rank%><% } %></b>
        <% if(ranklist[i].rankChangeInfo) { %>
          <%=ranklist[i].rankChangeInfo.desc%>
        <% } %>
      </span>
      <a href="clubDetailNo?clubId=<%=ranklist[i].clubId %>">
       <img src="<%=ranklist[i].image%>?imageView2/2/w/128"/>
      </a>
      <p><%=ranklist[i].clubName%></p>
      <span style="width:48px;" class="color_dakgray ml10"><%=ranklist[i].rankValue%></span>
    </div>
 
  </li>
  <% } %>
</script>
<!-- 配速 里程 人气 榜 -->
<script id="all-member_tpl" type="text/html">

  <% for(var i = 0; i < ranklist.length; i++) { %>

  <li<% if(isMe != undefined && isMe == 1) { %> class="me"<% } %>>
    <span<% if(ranklist[i].rankValue  * 1 < 0) { %> class="down"<% } else if(ranklist[i].rankValue  * 1 > 0) { %> class="up"<% } %>>
      <b><% if(!ranklist[i].rank) { %>--<% } else { %><%=ranklist[i].rank%><% } %></b>
      <% if(ranklist[i].rankChangeInfo) { %>
        <%=ranklist[i].rankChangeInfo.desc%>
      <% } %>
    </span>
    <a href="clubDetailNo?clubId=<%=ranklist[i].clubId%>">
      <img src="<%=ranklist[i].image%>?imageView2/2/w/128"/>
    </a>
    <p><%=ranklist[i].clubName%></p>
    <span class="color_dakgray"><%if(ranklist[i].rankValue==0){%>--<%}else{%><%=ranklist[i].rankValue%><%}%></span>
  </li>
  <% } %>
</script>
<!-- 积分排行模板 -->
<script type="text/javascript">
var myScroll;
function loaded () {
  myScroll = new IScroll('#wrapper', { bounceEasing: 'elastic', bounceTime: 100 });
}
function renderHome(data){
  $('.rank_tab').click(function(){
    var tab_class = $(this).attr('id');
    $('.rank_tab').each(function(){
      if($(this).attr('id') == tab_class) {
        $(this).addClass('on');
      } else {
        $(this).removeClass('on');
      }
    });
    $('#wrapper section').each(function(){
      if($(this).hasClass(tab_class)) {
        $(this).show();
        showRank(tab_class);
      } else {
        $(this).hide();
      }
    });
  });

  $('#all-member').click();
}

function showRank(tab) {
  var rankTypes = {
    'all-zlc': 0,
    'all-pace': 1,
    'all-moods': 2,
    'all-member': 3
  };

  if(!tab && rankType) {
    tab = rankType;
  }

  if(rankTypes[tab] == undefined) {
    return;
  } else {
    rankType = tab;
  }
  var param = {'roundId': currentRoundId, 'typeWd': rankTypes[tab], 'clubName': sq};
  $.get('{$appHost}/gameWeb/getRankList',param, renderRank);
}
function renderRank(data) {
  data = JSON.parse(data);
  if(data.result.ranklist != undefined) {

    var rank = {'ranklist': []};
    var tpl = rankType == 'all-member' ? 'all-member_tpl' : 'all-zlc_tpl';
    var html = '';

    $('.' + rankType + ' ul').hide();
    $('.' + rankType + ' .empty-box').hide();
    
    // if(data.list.topRankInfo != undefined && JSON.stringify(data.list.topRankInfo).length > 2) {
    //   rank.list[0] = data.list.topRankInfo;
    //   rank.isMe = 1;
    //   html = template(tpl, rank);
    //   $('.' + rankType + ' .top').html(html).show();
    //   rank.isMe = 0;
  
    // }

    if(data.result.ranklist != undefined && data.result.ranklist > 0) {
      rank.list = data.result.ranklist;
      html = template(tpl, rank);
      $('.' + rankType + ' .list').html(html).show();

    }
    if(data.result.ranklist.length == 0) {

      $('.' + rankType + ' .empty-box').show();
    }else{
      $(".mileage-title").show();
    }

    if(rankType == 'all-zlc' ){
      $(".text-box").html("今日跑量").show()
      $(".small-text").html("跑量")
    }
    if(rankType == 'all-pace'){
      $(".text-box").html("今日配速").show()
      $(".small-text").html("配速")
    }
    if(rankType == 'all-moods'){
      $(".text-box").html("累计人气").show()
      $(".small-text").html("人气")
    }
  }
}

</script>

</html>
